require "optparse"
class DeployerOptions
	attr_accessor :options
	def initialize()
		@options = {}
		optparse = OptionParser.new do |opts|
			opts.banner = "Example usage: deployer.rb -p PROJECT_NAME"
			
			@options[:verbose] = false
			opts.on( '-V', '--verbose', 'Output more information' ) do
				@options[:verbose] = true
			end
 
			@options[:list] = false
			opts.on( '-l', '--list' , 'List the projects under deployer control') do
				@options[:list] = true
			end
			
#			@options[:addproject] = false
#			opts.on('-a','--add-project', 'Adds a project to deployer control.') do
#				@options[:addproject] = true
#			end
			
#			@options[:removeproject] = false
#			opts.on('-r','--remove-project', 'Removes a project from deployer control.') do
#				@options[:removeproject] = true
#			end
			
			@options[:projectname] = nil
			opts.on( '-p', '--project-name NAME', 'Commits project NAME to tag') do |name|
				@options[:projectname] = name
			end
			
			@options[:commitlatest] = true
			opts.on('-o','--omit-latest','Do not commit to latest') do
				@options[:commitToLatest] = false
			end
			
			@options[:tagname] = nil
			opts.on('-t','--tag', 'Commit to tag TAG') do |tagname|
				@options[:tagname] = tagname
			end
			
#			@options[:major] = false
#			opts.on('-v','--increase-major-version','Increase major version number by 1') do
#				@options[:major] = true
#			end
			
#			@options[:minor] = false
#			opts.on('-m','--increase-minor-version','Increase minor version number by 1') do
#				@options[:minor] =true
#			end
			
			@options[:run] = true
			opts.on('-s','--simulate','Just simulate the deploy, do not commit') do
				@options[:run] = false
			end
			
			# This displays the help screen, all programs are
			# assumed to have this option.
			opts.on( '-h', '--help', 'Display this screen' ) do
				 puts opts
				 exit
			end
		end
		
		optparse.parse!
		
		
	end
end